// produzido por Neri Aldoir Neitzke
// www.informaticon.com.br
package cadastros;

import utilitarios.beans_thread;
import utilitarios.data;
import javax.swing.*;

public class TelaPrincipal extends javax.swing.JFrame {

    data mostra_data;
    String seta_look = "javax.swing.plaf.metal.MetalLookAndFeel";

    /** Creates new form TelaPrincipal */
    public TelaPrincipal() {
        initComponents();
        mostra_data = new data();
        mostra_data.le_data();
        label_data.setText(mostra_data.dia + ", " + mostra_data.dia_semana +
                " de " + mostra_data.mes + " de " + mostra_data.ano);

        timer1.start();
        lookandfeel();


    }

    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        timer1 = new org.netbeans.examples.lib.timerbean.Timer();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        label_data = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        label_hora = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        botao_cidade = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lbUsuario = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        menu_cadastros = new javax.swing.JMenu();
        menuitem_cliente = new javax.swing.JMenuItem();
        menuitem_funcionario = new javax.swing.JMenuItem();
        jMenuItem6 = new javax.swing.JMenuItem();
        menuitem_cidade = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuItem8 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        menu_estoque = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        jMenuItem7 = new javax.swing.JMenuItem();
        mi_logradouro = new javax.swing.JMenuItem();
        menu_consultas = new javax.swing.JMenu();
        menu_relatorios = new javax.swing.JMenu();
        jmenu_utilitarios = new javax.swing.JMenu();
        menu_threads = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JSeparator();
        jitem_menu_windows = new javax.swing.JMenuItem();
        jitem_menu_liquid = new javax.swing.JMenuItem();
        jmenu_item_metal = new javax.swing.JMenuItem();
        jitem_menu_cde_motif = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();

        timer1.addTimerListener(new org.netbeans.examples.lib.timerbean.TimerListener() {
            public void onTime(java.awt.event.ActionEvent evt) {
                timer1OnTime(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema para controle de Estoque");
        jLabel1.setIcon(new javax.swing.ImageIcon("C:\\Estoque\\imagens\\logo.jpg"));

        jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Estoque\\imagens\\neri.jpg"));
        jLabel2.setText("Sistema desenvolvido por Neri Neitzke");

        label_data.setText("Data.:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel3.setForeground(new java.awt.Color(255, 0, 0));
        jLabel3.setText("www.informaticon.com.br");

        label_hora.setText("Hora.:");

        jPanel1.setBackground(new java.awt.Color(153, 255, 102));
        jButton1.setIcon(new javax.swing.ImageIcon("C:\\Controle_estoque\\imagens\\usuarios.gif"));
        jButton1.setText("Clientes");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        botao_cidade.setIcon(new javax.swing.ImageIcon("C:\\Controle_estoque\\imagens\\cadastro_cidades.gif"));
        botao_cidade.setText("Cidades");
        botao_cidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botao_cidadeActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon("C:\\Controle_estoque\\imagens\\cadastro_bairros.gif"));
        jButton3.setText("Bairros");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon("C:\\Controle_estoque\\imagens\\sair.gif"));
        jButton4.setText("Sair");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton1)
                .addGap(18, 18, 18)
                .addComponent(botao_cidade)
                .addGap(14, 14, 14)
                .addComponent(jButton3)
                .addGap(16, 16, 16)
                .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(316, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botao_cidade, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jLabel4.setFont(new java.awt.Font("MS Sans Serif", 0, 36));
        jLabel4.setText("SCE - Sistema para Controle de Estoque");

        jLabel5.setText("Usuario.:");

        menu_cadastros.setMnemonic('C');
        menu_cadastros.setText("Cadastros");
        menuitem_cliente.setIcon(new javax.swing.ImageIcon("C:\\Estoque\\imagens\\usuarios.gif"));
        menuitem_cliente.setMnemonic('C');
        menuitem_cliente.setText("Clientes");
        menu_cadastros.add(menuitem_cliente);

        menuitem_funcionario.setMnemonic('F');
        menuitem_funcionario.setText("Funcion\u00e1rios");
        menu_cadastros.add(menuitem_funcionario);

        jMenuItem6.setText("Cargo");
        menu_cadastros.add(jMenuItem6);

        menuitem_cidade.setText("Cidades");
        menu_cadastros.add(menuitem_cidade);

        jMenuItem4.setText("Cidade");
        menu_cadastros.add(jMenuItem4);

        jMenuItem5.setText("Bairro");
        menu_cadastros.add(jMenuItem5);

        jMenuItem8.setText("Fornecedores");
        menu_cadastros.add(jMenuItem8);

        menu_cadastros.add(jSeparator2);

        menu_estoque.setMnemonic('E');
        menu_estoque.setText("Estoque");
        jMenuItem1.setText("Implanta\u00e7\u00e3o");
        menu_estoque.add(jMenuItem1);

        jMenuItem2.setText("Entrada");
        menu_estoque.add(jMenuItem2);

        jMenuItem3.setText("Sa\u00edda");
        menu_estoque.add(jMenuItem3);

        menu_cadastros.add(menu_estoque);

        menu_cadastros.add(jSeparator1);

        jMenuItem7.setText("Sair");
        menu_cadastros.add(jMenuItem7);

        mi_logradouro.setText("Logradouro");
        mi_logradouro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mi_logradouroActionPerformed(evt);
            }
        });

        menu_cadastros.add(mi_logradouro);

        jMenuBar1.add(menu_cadastros);

        menu_consultas.setMnemonic('n');
        menu_consultas.setText("Consultas");
        jMenuBar1.add(menu_consultas);

        menu_relatorios.setMnemonic('R');
        menu_relatorios.setText("Relat\u00f3rios");
        jMenuBar1.add(menu_relatorios);

        jmenu_utilitarios.setMnemonic('U');
        jmenu_utilitarios.setText("Utilit\u00e1rios");
        menu_threads.setText("Aprendendo sobre o uso de Threads");
        menu_threads.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menu_threadsActionPerformed(evt);
            }
        });

        jmenu_utilitarios.add(menu_threads);

        jmenu_utilitarios.add(jSeparator3);

        jitem_menu_windows.setText(" Look And Feel - Windows");
        jitem_menu_windows.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jitem_menu_windowsActionPerformed(evt);
            }
        });

        jmenu_utilitarios.add(jitem_menu_windows);

        jitem_menu_liquid.setText(" Look And Feel - Liquid");
        jitem_menu_liquid.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jitem_menu_liquidActionPerformed(evt);
            }
        });

        jmenu_utilitarios.add(jitem_menu_liquid);

        jmenu_item_metal.setText(" Look And Feel - Metal");
        jmenu_item_metal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmenu_item_metalActionPerformed(evt);
            }
        });

        jmenu_utilitarios.add(jmenu_item_metal);

        jitem_menu_cde_motif.setText(" Look And Feel - CDE/MOTIF");
        jitem_menu_cde_motif.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jitem_menu_cde_motifActionPerformed(evt);
            }
        });

        jmenu_utilitarios.add(jitem_menu_cde_motif);

        jMenuBar1.add(jmenu_utilitarios);

        jMenu5.setMnemonic('S');
        jMenu5.setText("Sair");
        jMenu5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenu5MouseClicked(evt);
            }
        });
        jMenu5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu5ActionPerformed(evt);
            }
        });

        jMenuBar1.add(jMenu5);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(label_data)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(label_hora))
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 315, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(218, 218, 218)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(227, 227, 227))
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 782, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 734, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(199, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(52, 52, 52)
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(73, 73, 73)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(26, 26, 26)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(label_data)
                    .addComponent(label_hora)
                    .addComponent(jLabel5)
                    .addComponent(lbUsuario))
                .addGap(24, 24, 24))
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel4)
                .addContainerGap(460, Short.MAX_VALUE))
        );
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-800)/2, (screenSize.height-555)/2, 800, 555);
    }// </editor-fold>//GEN-END:initComponents

    private void mi_logradouroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mi_logradouroActionPerformed
        new logradouro().show();
    }//GEN-LAST:event_mi_logradouroActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        new bairro().show();
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jitem_menu_cde_motifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jitem_menu_cde_motifActionPerformed
        seta_look = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
        lookandfeel();
    }//GEN-LAST:event_jitem_menu_cde_motifActionPerformed

    private void jmenu_item_metalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmenu_item_metalActionPerformed
        seta_look = "javax.swing.plaf.metal.MetalLookAndFeel";
        lookandfeel();
    }//GEN-LAST:event_jmenu_item_metalActionPerformed

    private void jitem_menu_liquidActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jitem_menu_liquidActionPerformed
        seta_look = "com.birosoft.liquid.LiquidLookAndFeel";
        lookandfeel();
    }//GEN-LAST:event_jitem_menu_liquidActionPerformed

    private void jitem_menu_windowsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jitem_menu_windowsActionPerformed
        seta_look = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
        lookandfeel();
    }//GEN-LAST:event_jitem_menu_windowsActionPerformed

    private void menu_threadsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menu_threadsActionPerformed
        new beans_thread().show();
    }//GEN-LAST:event_menu_threadsActionPerformed

    private void jMenu5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu5MouseClicked
        System.exit(0);
    }//GEN-LAST:event_jMenu5MouseClicked

    private void jMenu5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu5ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu5ActionPerformed

    private void timer1OnTime(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timer1OnTime
        mostra_data.le_hora();
        label_hora.setText("Hora atual " + mostra_data.hora);
    }//GEN-LAST:event_timer1OnTime

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        new cliente().show();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void botao_cidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botao_cidadeActionPerformed
        new cad_cidade().show();
    }//GEN-LAST:event_botao_cidadeActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new TelaPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton botao_cidade;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JMenuItem jitem_menu_cde_motif;
    private javax.swing.JMenuItem jitem_menu_liquid;
    private javax.swing.JMenuItem jitem_menu_windows;
    private javax.swing.JMenuItem jmenu_item_metal;
    private javax.swing.JMenu jmenu_utilitarios;
    private javax.swing.JLabel label_data;
    private javax.swing.JLabel label_hora;
    public static javax.swing.JLabel lbUsuario;
    private javax.swing.JMenu menu_cadastros;
    private javax.swing.JMenu menu_consultas;
    private javax.swing.JMenu menu_estoque;
    private javax.swing.JMenu menu_relatorios;
    private javax.swing.JMenuItem menu_threads;
    private javax.swing.JMenuItem menuitem_cidade;
    private javax.swing.JMenuItem menuitem_cliente;
    private javax.swing.JMenuItem menuitem_funcionario;
    private javax.swing.JMenuItem mi_logradouro;
    private org.netbeans.examples.lib.timerbean.Timer timer1;
    // End of variables declaration//GEN-END:variables

    public void lookandfeel() {
        try {
            UIManager.setLookAndFeel(seta_look);
            SwingUtilities.updateComponentTreeUI(this);
        } catch (Exception erro) {
            JOptionPane.showMessageDialog(null, erro);
        }
    }
}
           //UIManager.setLookAndFeel("com.birosoft.liquid.LiquidLookAndFeel");
           //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
           //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
